﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.Web;
using SilentVoice.Models;

namespace SilentVoice.ServiceObjects
{
    public class ServiceEvent
    {
        private Event svEvent;

        public ServiceEvent(Event svEvent)
        {
            this.svEvent = svEvent;
        }

        public string Name
        {
            get { return this.svEvent.Name; }
            set { this.svEvent.Name = value; }
        }

        public int AccountId
        {
            get { return this.svEvent.AccountId; }
            set { this.svEvent.AccountId = value; }
        }

        public string Description
        {
            get { return this.svEvent.Description; }
            set { this.svEvent.Description = value; }
        }

        public IEnumerable<ServiceGroup> AllowedGroups
        {
            get { return this.svEvent.AllowedGroups.Select(x => new ServiceGroup(x)); } 
        }

        public string Outline
        {
            get { return this.svEvent.Outline; }
            set { this.svEvent.Outline = value; }
        }

        public int CreatorId
        {
            get { return this.svEvent.OwnerId; }
        }

        public DateTime LastModifiedAt
        {
            get { return this.svEvent.ModifiedAt; }
        }

        public DateTime CreatedAt
        {
            get { return this.svEvent.CreatedAt; }
        }

        public Event Event { get { return this.svEvent; } }

    }
}